package com.usefullc.common.enums;


import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;

/**
 * 应用类型
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AppTypeEnum {


    ADMIN("admin", "后台管理"),

    DEMO("demo", "示例"),

    USER("user", "用户中心"),

    SYSTEM("system", "系统"),

    CRAWLER("crawler", "爬虫"),

    CODE_BUILD("code-build", "代码构建"),

    BLOG("blog", "个人博客"),



    ;


    private String code;
    private String value;

    AppTypeEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }



    public static AppTypeEnum getByCode(String code) {
        if (code == null) {
            return null;
        }
        for (AppTypeEnum s : AppTypeEnum.values()) {
            if (StringUtils.equals(s.getCode(),code)) {
                return s;
            }
        }
        return null;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {


        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

}
